/*
 * Copyright (C) 2011  John Lawrence thegordo.john at gmail.com
 * Licensed under GPLv3 or later. see http://www.gnu.org/copyleft/gpl.html
 */

package org.jklawrencefam.server;

/**
 * User: John Lawrence
 * Date: 5/19/11
 * Time: 11:51 PM
 */
public class MultiClientServer extends Thread {
    private Server server;

    public MultiClientServer(Server server) {
        this.server = server;
    }

    @Override
    public void run() {
        server.configure();
        server.openPort();
        try {
            //noinspection InfiniteLoopStatement
            while (true) {
                server.acceptConnections();
            }
        } finally {
            server.close();
        }
    }
}
